if lib and not lib.sys_message then


lib.sys_message = message


function message(v, l)
	l = l or 1
	v = tostring(v)
	
	if not lib.global
		or not lib.global.message_level 
		or lib.global.message_level <= l
	then
		local prefix = ""
		
		if script_name then
			prefix = script_name .. " "
		end
		
		if l == 2 then
			lib.sys_message("? " .. prefix .. v, 2)
		elseif l == 3 then
			lib.sys_message("! " .. prefix .. v, 3)
		else
			lib.sys_message("+ " .. prefix .. v, 1)
		end
	end
	
	return v
end


function warning(v)
	return message(v, 2)
end


function fail(v)
	return message(v, 3)
end


end -- of file
